#include "Expr.h"


Expr::Expr(Token *_tok)
    : token(_tok), type(FLT)
{
}


Expr::~Expr(void)
{
    delete token;
}

int Expr::EvalInt()
{
    if (type == INT)
    {
        return DoEvalInt();
    }
    else if (type == FLT)
    {
        return (int)DoEvalFlt();
    }
    else
    {
        assert(0);
        return -1;
    }
}

float Expr::EvalFlt()
{
    if (type == INT)
    {
        return (float)DoEvalInt();
    }
    else if (type == FLT)
    {
        return DoEvalFlt();
    }
    else
    {
        assert(0);
        return -1;
    }
}

int Expr::DoEvalInt()
{
    return -1;
}

float Expr::DoEvalFlt()
{
    return -1;
}
